﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>绑定的问题</title>
    <style>
      #contextmenu {
        width: 200px;
        height: 200px;
        background: red;
      }
    </style>
  </head>
  <body>
    <div id="contextmenu"></div>
  </body>
  <script>
    document.getElementById("contextmenu").addEventListener(
      "contextmenu",
      function(ev) {
        var oEvt = ev || event;
        oEvt.preventDefault(); //阻止默认
      },
      false
    );
  </script>
</html>
